#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <errno.h>
#include <sys/types.h>
#include <sys/ipc.h>
#include <sys/msg.h>
#include <sys/stat.h>
#define MSG_FILE "msgserver.c"
#define BUFFER 255
#define PERM S_IRUSR|S_IWUSR

int main(int argc, char *argv[])
{
	key_t key;
	int msgid;

	if((key = ftok(MSG_FILE,'a')) == -1)
	{
		printf("Create Key Error:%s\n", strerror(errno));
		return -1;
	}
	if((msgid = msgget(key, PERM)) == -1)
	{
		printf("Create Message Error:%s\n", strerror(errno));
		return -1;
	}
	struct msqid_ds *buf;
	msgctl(msgid,IPC_RMID,buf);
	return 0;
}
